package com.mm.base.exception;


import com.mm.util.result.IResultCode;

/**
 * 描述: 自定义笔记异常
 *
 * @author: yanglin
 * @Date: 2021-05-18-10:47
 * @Version: 1.0
 */
public class MuMuException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    protected String errorCode;

    protected String errorMsg;

    public MuMuException() {
        super();
    }

    public MuMuException(IResultCode resultCode) {
        super(resultCode.getCode());
        this.errorCode = resultCode.getCode();
        this.errorMsg = resultCode.getMsg();
    }

    public MuMuException(IResultCode resultCode, Throwable cause) {
        super(resultCode.getCode(), cause);
        this.errorCode = resultCode.getCode();
        this.errorMsg = resultCode.getMsg();
    }

    public MuMuException(String errorMsg) {
        super(errorMsg);
        this.errorMsg = errorMsg;
    }

    public MuMuException(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public MuMuException(String errorCode, String errorMsg, Throwable cause) {
        super(errorMsg, cause);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
